package cn.itcast.itcaststore.service.Impl;

import cn.itcast.itcaststore.dao.Impl.IProductDao;
import cn.itcast.itcaststore.domain.Products;
import cn.itcast.itcaststore.service.ProductService;

import java.util.List;

public class IProductService implements ProductService {
    private IProductDao iProductDao = new IProductDao();


    @Override
    public List getListProduct(String category, int currentPage, int orderByDate) {
        List list=iProductDao.getListProduct(category,currentPage,orderByDate);
        return list;
    }

    @Override
    public Products getProducts(String id) {
        Products products = iProductDao.getProducts(id);
        return products;
    }

    @Override
    public int getTotalDate(String category) {
        int num=iProductDao.getTotalDate(category);
        return num;
    }

    @Override
    public List getListByname(String name, int currentPage, int orderByDate) {
        List list=iProductDao.getProductByname(name,currentPage,orderByDate);
        return list;
    }

    @Override
    public int getTotalDateByName(String name) {
        int num=iProductDao.getTotalDateByName(name);
        return num;
    }

    @Override
    public Products getProductsById(String id) {
        Products products=iProductDao.getProductsById(id);
        return products;
    }
}
